import request from '@/utils/request'

// 查询辅料领料单头列表
export function listAccessory(query) {
  return request({
    url: '/mes/wm/accessory/list',
    method: 'get',
    params: query
  })
}

// 查询辅料领料单头详细
export function getAccessory(wmIssueId) {
  return request({
    url: '/mes/wm/accessory/' + wmIssueId,
    method: 'get'
  })
}

// 新增辅料领料单头
export function addAccessory(data) {
  return request({
    url: '/mes/wm/accessory',
    method: 'post',
    data: data
  })
}

// 修改辅料领料单头
export function updateAccessory(data) {
  return request({
    url: '/mes/wm/accessory',
    method: 'put',
    data: data
  })
}

// 删除辅料领料单头
export function delAccessory(wmIssueId) {
  return request({
    url: '/mes/wm/accessory/' + wmIssueId,
    method: 'delete'
  })
}

//执行出库
export function execute(wmIssueId) {
  return request({
    url: '/mes/wm/accessory/' + wmIssueId,
    method: 'put'
  })
}

// 新增生产领料
export function getAccessoryList(query) {
  return request({
    url: '/mes/wm/accessory/getAccessoryList/',
    method: 'get',
    params: query
  })
}
